package com.example.demoexcel.controller;

import com.example.demoexcel.service.IAreaStationDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 赵恒
 * @date 2023/7/11
 */
@RestController
@RequestMapping("areaStationData")
@Api(tags = "区域站")
public class AreaStationDataController {
    @Resource
    IAreaStationDataService iAreaStationDataService;

    @ApiOperation("批量写入CSV")
    @GetMapping("saveCsv")
    public String saveBatch() {
        iAreaStationDataService.readCsvToDatabase("");
        return "写入成功";
    }

    @ApiOperation("查询数量")
    @GetMapping("queryCount")
    public Long query() {
        return iAreaStationDataService.count();
    }

}
